package com.deliinsns.app.company;
import java.util.List;
import org.springframework.util.CollectionUtils;
import com.deliinsns.app.company.bean.Company;
import com.deliinsns.sys.BasicDao;
public class CompanyDao extends BasicDao<Company> {

	public Company getByUsername(String name) {
		 Company company= null;
		 List<Company> list= this.findByHql("from Company t where t.username =?",name);
		 if(!CollectionUtils.isEmpty(list)){
			 company=  list.get(0);
		 }
		 return company;
	}
	public Company getById(String id) {
		return this.get(Company.class, id);
	}
	
}
